<template>
    <div>

        <table class="my-table">
            <thead>
                <tr>
                    <slot name="head"></slot>
                </tr>
            </thead>
            <tbody>
                <tr v-for="(item, index) in records" :key="index">
                    <slot name="body" :item="item" :index="index"></slot>
                </tr>
            </tbody>
        </table>
    </div>
</template>
<script>
export default {
    props: {
        records: Array
    },
    methods: {

    }
}
</script>
<style scoped>
.my-table {
    border-collapse: collapse;
    width: 100%;
}

.my-table td,
.my-table th {
    border: 1px solid #ddd;
    padding: 8px;
    text-align: left;
}

.my-table th {
    background-color: #f2f2f2;
}
</style>